import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ConfigElementType 1.0
import "qrc:/qmlComponents/ConfigManager"
import "qrc:/qmlComponents/AxisModulePos"
import "qrc:/qmlComponents/VisionViewer"
import "qrc:/qmlComponents/CustomizedUIElement/RowColumnSelectorView"

Item {
    RowLayout{
        spacing: 30

        GroupBox{
            title: qsTr("LensTrayOperation")
            Layout.alignment: Qt.AlignTop

            ColumnLayout{
                ColumnLayoutRowColumnSelector{
                    rowColInfo: ltlRowColInfo
                }
                Button{
                    text: qsTr("MoveToPrPos")
                    onClicked: {
                        tem.runSingleCmd(lensTrayLoader, "moveToPrPos",
                                         [ltlRowColInfo.unitRow, ltlRowColInfo.unitColumn, ltlRowColInfo.row, ltlRowColInfo.column])
                    }
                }
                Button{
                    text: qsTr("MoveToPerformLensPr")
                    onClicked: {
                        tem.runSingleCmd(lensTrayLoader, "moveToPerformLensPr",
                                         [ltlRowColInfo.unitRow, ltlRowColInfo.unitColumn, ltlRowColInfo.row, ltlRowColInfo.column])
                    }
                }
                Button{
                    text: qsTr("MoveToPerformVacancyPr")
                    onClicked: {
                        tem.runSingleCmd(lensTrayLoader, "moveToPerformVacancyPr",
                                         [ltlRowColInfo.unitRow, ltlRowColInfo.unitColumn, ltlRowColInfo.row, ltlRowColInfo.column])
                    }
                }
                Rectangle{
                    width: 10
                    height: 10
                    color: "transparent"
                }

                Button{
                    text: qsTr("PickLens")
                    onClicked: {
                        tem.runSingleCmd(bonderHead, "manuallyPickLens",
                                         [ltlRowColInfo.unitRow, ltlRowColInfo.unitColumn, ltlRowColInfo.row, ltlRowColInfo.column])
                    }
                }
                Button{
                    text: qsTr("MoveToPerformUplookPr")
                    onClicked: {
                        tem.runSingleCmd(bonderHead, "moveToPerformUplookPr")
                    }
                }
                Button{
                    text: qsTr("PlaceBackLens")
                    onClicked: {
                        tem.runSingleCmd(bonderHead, "manuallyPlaceBackLens",
                                         [ltlRowColInfo.unitRow, ltlRowColInfo.unitColumn, ltlRowColInfo.row, ltlRowColInfo.column])
                    }
                }
            }
        }

        GroupBox{
            title: qsTr("SensorTrayOperation")
            Layout.alignment: Qt.AlignTop

            ColumnLayout{
                ColumnLayoutRowColumnSelector{
                    rowColInfo: bwhRowColInfo
                }
                Button{
                    text: qsTr("MoveToPrPos")
                    onClicked: {
                        tem.runSingleCmd(bonderWorkHolder, "moveToPrPos",
                                         [bwhRowColInfo.unitRow, bwhRowColInfo.unitColumn, bwhRowColInfo.row, bwhRowColInfo.column])
                    }
                }
                Button{
                    text: qsTr("MoveToPerformSensorPr")
                    onClicked: {
                        tem.runSingleCmd(bonderWorkHolder, "moveToPerformSensorPr",
                                         [bwhRowColInfo.unitRow, bwhRowColInfo.unitColumn, bwhRowColInfo.row, bwhRowColInfo.column])
                    }
                }
                Button{
                    text: qsTr("MoveToPerformPostBondPr")
                    onClicked: {
                        tem.runSingleCmd(bonderWorkHolder, "moveToPerformPostBondPr",
                                         [bwhRowColInfo.unitRow, bwhRowColInfo.unitColumn, bwhRowColInfo.row, bwhRowColInfo.column])
                    }
                }
                Rectangle{
                    width: 10
                    height: 10
                    color: "transparent"
                }
                CheckBox{
                    id: ckbDoPostBond
                    text: qsTr("DoPostBond")
                    checked: true
                }
                Button{
                    text: qsTr("Bond")
                    onClicked: {
                        tem.runSingleCmd(bonderHead, "manuallyBond",
                                         [bwhRowColInfo.unitRow, bwhRowColInfo.unitColumn, bwhRowColInfo.row, bwhRowColInfo.column, ckbDoPostBond.checked])
                    }
                }
            }
        }
    }
}
